
$(function() {
    (function onScroll(){
        var strStyle = '.fixed_right{position:fixed; top:0; left:50%; margin-left:328px; _position: absolute; _bottom: auto; _top: expression(eval(document.documentElement.scrollTop)+0); } * html{background-image:url(about:blank); background-attachment:fixed; } .fixed_right_2{position: absolute; top:4717px; }'
        var oStyle = $('<style>');
        oStyle.html(strStyle);
        oStyle.attr('type','text/css');
        $('head').append(oStyle);
        
        var otop=$("#fixed_right").offset().top;
        $(window).scroll(function () {     
                                 //屏幕滚动事件
            if($(window).scrollTop()<otop){
             $("#fixed_right").removeClass('fixed_right_2');              //因为ie6兼容固定定位问题，所以都用添加类和删除类
             $("#fixed_right").removeClass('fixed_right');
            }else if ($(window).scrollTop()>=otop) {
             $("#fixed_right").removeClass('fixed_right_2');
             $("#fixed_right").addClass('fixed_right');
             // console.log('定位');
            }
        });
    })();
});
